Other than being arguably more human readable,
this patch reconciles the output differences between
using Xen API and xmlrpc to manipulate domains.
Signed-off-by: Simon Horman <horms@verge.net.au>
def PCI_DEVFN(slot, func):
return ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+def PCI_BDF(domain, bus, slot, func):
+ return (((domain & 0xffff) << 16) | ((bus & 0xff) << 8) |
+ PCI_DEVFN(slot, func))
+
def serialise_pci_opts(opts):
return reduce(lambda x, y: x+','+y, map(lambda (x, y): x+'='+y, opts))
if len(devs) == 0:
return
+ devs.sort(None, lambda x: x['vslot'] << 32 | PCI_BDF(x['domain'], x['bus'],
+ x['slot'], x['func']))
+
has_vslot = False
for x in devs:
if x['vslot'] == AUTO_PHP_SLOT: